package com.larry.mapreduce.outputformat;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.RecordWriter;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import java.io.IOException;

/**
 * @ProjectName MapReduceDemo
 * @Author larry
 * @Date 20:34 2021/11/8
 * @Description TODO
 **/
public class LogOutPutFormat extends FileOutputFormat<Text, NullWritable> {
    @Override
    public RecordWriter<Text, NullWritable> getRecordWriter(TaskAttemptContext taskAttemptContext) throws IOException {

        LogRecordWriter lrw = new LogRecordWriter(taskAttemptContext);

        return lrw;
    }
}
